package com.chao.yyks.modular.config.service;

import com.chao.common.util.file.FileUpload;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;

/**
 * 文件资源表 服务 消费端
 * chang
 * 2020-07-29
 */
public interface FdfsService {

	/**
	 * 文件上传
	 */
	FileUpload uploadFile(MultipartFile file);

	/**
	 * 文件上传
	 */
	FileUpload uploadThisFile(File file);

	/**
	 * 文件上传
	 */
	FileUpload uploadByteFile(byte[] bytes, String fileName);

	/**
	 * 文件上传
	 */
	FileUpload uploadFileBase64(String base64, String fileName);

	/**
	 * 附件下载
	 */
	void downLoadFile(HttpServletResponse response, String fileId) throws IOException;

}
